package com.kuzan.autocloud.common.model.form;

import com.kuzan.autocloud.common.model.form.link.FormSyeneryLink;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * <p>Description: 关联选择项</p>
 *
 * @author kuzank
 */
@Data
@NoArgsConstructor
@Entity
@Table(name = "sys_form_relevance")
public class FormRelevance extends FormSyeneryLink {

    @Column(length = 32)
    private String report;
    @Column
    private String idkey = "id";
    @Column
    private String name = "title";

    public static FormRelevance of(String title, String form, String report, String id) {
        FormRelevance obj = new FormRelevance();
        obj.setTitle(title);
        obj.setForm(form);
        obj.setReport(report);
        obj.setId(id);
        obj.setSort(getSortIncrement());
        return obj;
    }

}
